-- p. 60 #1
data List a = Cons a (List a)
            | Nil
              deriving (Show)

fromList :: [a] -> List a
fromList []     = Nil
fromList (x:xs) = Cons x (fromList xs)

toList :: List a -> [a]
toList (Cons a as) = a : toList as
toList Nil         = []
